<?php

require_once 'Zend/Form.php';
require_once 'Zend/Form/Element/Hidden.php';
require_once 'Zend/Form/Element/Text.php';
require_once 'Zend/Form/Element/Password.php';
require_once 'Zend/Form/Element/Submit.php';

class LoginForm extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('login');
        $id = new Zend_Form_Element_Hidden('id');
        $Alias = new Zend_Form_Element_Text('Alias');
        $Alias->setLabel('Alias')
			->setRequired(true)
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->addValidator('NotEmpty')
			->addValidator('StringLength', false, array(3, 20));
        $Password = new Zend_Form_Element_Password('Password');
        $Password->setLabel('Password')
			->setRequired(true)
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->addValidator('NotEmpty')
			->addValidator('StringLength', false, array(4, 20));
        $submit = new Zend_Form_Element_Submit('Login');
        $submit->setAttrib('id', 'submitbutton');
        $this->addElements(array($id, $Alias, $Password, $submit));

		$this->setDecorators(array(
		'FormElements',
		array('HtmlTag', array('tag' => 'dl', 'class' => 'loginform')),
		array('Description', array('placement' => 'prepend')),
		'Form'
		));

    }
}


?>
